package com.spark.lola.entity.warehouse;

import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.TableName;
import com.spark.lola.dto.warehouse.FztPurOrder;
import com.spark.lola.support.common.constant.BooleanConstant;
import com.spark.lola.support.common.util.TimeUtil;
import com.spark.lola.support.mybatis.entity.BaseModel;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 采购入库单
 * </p>
 *
 * @author dengyejun
 * @since 2020-06-15
 */
@TableName("warehouse_order_info")
@ApiModel(value="OrderInfo对象", description="采购入库单")
public class OrderInfo extends BaseModel implements Serializable {
    private static final long serialVersionUID=1L;
    public OrderInfo(){}
    public OrderInfo(FztPurOrder fztPurOrder){
        this.storeId = Long.valueOf(fztPurOrder.getOrganCode());
        this.no = fztPurOrder.getBno();
        this.supplierNo = fztPurOrder.getIcno();
        this.supplierName = fztPurOrder.getCustomer();
        this.status = BooleanConstant.FALSE;
        this.tradeDay =TimeUtil.parse(fztPurOrder.getTradeday()+" 00:00:00");
        BigDecimal weight = new BigDecimal(fztPurOrder.getWeightNet());
        this.weight = weight.divide(new BigDecimal(1000));
        this.productNo = fztPurOrder.getProduct();
        this.productName = fztPurOrder.getProductText();
        this.price = fztPurOrder.getPrice();
        this.total = fztPurOrder.getTotal();
        this.rater = fztPurOrder.getRater();
        this.reviewer = fztPurOrder.getReviewer();
    }
    private Long storeId;


    @ApiModelProperty(value = "订单号")
    private String no;

    @ApiModelProperty(value = "仓库")
    @TableField(exist = false)
    private String storeName;

    @ApiModelProperty(value = "供应商编码")
    private String supplierNo;

    @ApiModelProperty(value = "供应商")
    private String supplierName;

    @ApiModelProperty(value = "0:待结算 1:已完成")
    private Integer status;

    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    @ApiModelProperty(value = "交易日")
    private Date tradeDay;

    @ApiModelProperty(value = "净重")
    private BigDecimal weight;

    @ApiModelProperty(value = "货品No")
    private String productNo;

    @ApiModelProperty(value = "货品名称")
    private String productName;

    @ApiModelProperty(value = "单价")
    private BigDecimal price;

    @ApiModelProperty(value = "总价")
    private BigDecimal total;

    @ApiModelProperty(value = "定价员")
    private String rater;

    @ApiModelProperty(value = "审核员")
    private String reviewer;

    public String getStoreName() {
        return storeName;
    }

    public void setStoreName(String storeName) {
        this.storeName = storeName;
    }

    public Long getStoreId() {
        return storeId;
    }

    public void setStoreId(Long storeId) {
        this.storeId = storeId;
    }
    
    public String getNo() {
        return no;
    }

    public void setNo(String no) {
        this.no = no;
    }
    
    public String getSupplierNo() {
        return supplierNo;
    }

    public void setSupplierNo(String supplierNo) {
        this.supplierNo = supplierNo;
    }
    
    public String getSupplierName() {
        return supplierName;
    }

    public void setSupplierName(String supplierName) {
        this.supplierName = supplierName;
    }
    
    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public Date getTradeDay() {
        return tradeDay;
    }

    public void setTradeDay(Date tradeDay) {
        this.tradeDay = tradeDay;
    }

    public BigDecimal getWeight() {
        return weight;
    }

    public void setWeight(BigDecimal weight) {
        this.weight = weight;
    }


    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }
    
    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }
    
    public BigDecimal getTotal() {
        return total;
    }

    public void setTotal(BigDecimal total) {
        this.total = total;
    }
    
    public String getRater() {
        return rater;
    }

    public void setRater(String rater) {
        this.rater = rater;
    }
    
    public String getReviewer() {
        return reviewer;
    }

    public void setReviewer(String reviewer) {
        this.reviewer = reviewer;
    }

    public String getProductNo() {
        return productNo;
    }

    public void setProductNo(String productNo) {
        this.productNo = productNo;
    }
}
